package com.tqjc.execute.thread.aysn;

import com.tqjc.common.faulthandle.entity.FaultRecord;
import com.tqjc.common.faulthandle.service.FaultRecordService;
import com.tqjc.system.core.util.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: 86195
 * @CreateTime: 2024-06-03  10:27
 * @Description: TODO
 * @Version: 1.0
 */
@Slf4j
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AysnSaveFaultInfoThread extends Thread{

    private FaultRecord faultRecord;


    @Override
    public void run() {
        FaultRecordService service = SpringUtils.getBean(FaultRecordService.class);

        if(!service.isExistInfo(faultRecord)){
            //一分钟内，不存在则插入数据
            service.save(faultRecord);
        }

    }
}
